home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SCREEN.SWG / 0050_Screen Info.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  2KB  |  46 lines

  1. {
  2. > This would be a simple way to check for the screen size.
  3. > Clr The screen
  4. > Set the colors to Back on Background and Forground so that no one sees
  5. > what is happening.
  6. > Make a For L := 1 to 50;
  7. > Do a WriteLN(L);
  8. > then after the top line shgould have the letter "2" if it's a 50 lines
  9. > down else it would have 9 there.
  10. > to get the image just use the IF PORT[$B800:000] =$32 Then { 50 lines
  11. }
  12.  
  13. var
  14.  mode:byte absolute $40:$49;       {cur video mode}
  15.  columns:byte absolute $40:$4A;
  16.  dispSize:word absolute $40:$4C;   {cur page size in bytes}
  17.  dispOfs:word absolute $40:$4E;    {cur page offset}
  18.  cursor:array[0..7]of record x,y:byte;end absolute $40:$50;
  19.  cursorMode:word absolute $40:$60; {scan lines start/end?}
  20.  numPages:byte absolute $40:$62;   {video pages avail} {or activePage??}
  21.  crtcPort:word absolute $40:$63;   {CRTC port addr}
  22.  modeSave:byte absolute $40:$65;   {crtModeSet}
  23.  colorSave:byte absolute $40:$66;  {crtPalette}
  24.  
  25.  ticker:longint absolute $40:$6C;  {18.2x/sec} {timer}
  26.  
  27.  lastRow:byte absolute $40:$84;    {newer bios only:rows on screen-1}
  28.  points:byte absolute $40:$85;     {newer bios only:scan lines per char}
  29.  
  30. {
  31. These last two are the interesting ones. LastRow is set to rows-1 on newer
  32. bios's and by up-to-date programs that tweak the CRTC. Otherwise it will
  33. contain 0, meaning 25 lines, for older Bios's
  34.  
  35. There's a wealth of information up there, man.
  36.  
  37. And I think this:
  38. }
  39. function ScrnLines:word;begin
  40.  if lastRow=0 then lastRow:=24;   {set in case BIOS doesn't}
  41.  scrnLines:=lastRow+1;
  42.  end;
  43.  
  44.  
  45. {Untested but should work.}
  46.